import Mock from 'mockjs';

const mockRes = Mock.mock({
  code: 200,
  msg: 'success',
  'results|100': [
    {
      'objectId|+1': 1,
      name: '@cname',
      score: '@integer(50,100)',
      address: '@county(true)',
      birthday: '@date',
    },
  ],
});

export default {
  'GET /classes/student': mockRes,
  'DELETE /classes/student': (req, res) => {
    const objectId = +req.query.objectId;
    mockRes.results = mockRes.results.filter(
      (item) => item.objectId !== objectId,
    );
    res.send({ code: 200, msg: 'success' });
  },
};
